package com.harry12.mybatis.controller;

import com.harry12.mybatis.Mapper.StudentMapper;
import com.harry12.mybatis.entity.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
public class StudentController {
    @Resource
    StudentMapper studentMapper;
    @RequestMapping("/getStudent2")
    public String getStudent2(){
      List<Student> list = studentMapper.getStudent2();
        for(Student student:list){
            System.out.println(student.toString());
        }
        return "hhh";
    }
    @RequestMapping("/getStudents")
    public String getStudents(){
        List<Student> list = studentMapper.getStudents();
        for(Student student:list){
            System.out.println(student.toString());
        }
        return "sss";
    }
}
